import request from '@/router/axios';

export const getComputer = (currentPage, pageSize, params) => {
  return request({
    url: '/api/computer/openComputerTable',
    method: 'post',
    params: {
      ...params,
      currentPage,
      pageSize,
    }
  })
}

export const remove = (ids) => {
  return request({
    url: '/api/computer/deleteComputerByIds',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/api/computer/addComputer',
    method: 'post',
    params: {
      dname:row.dname,
      pid:row.pid,
      color:row.color,
      createTime:row.createTime,
      shellTime:row.shellTime
    }
  })
}

export const update = (row) => {
  return request({
    url: '/api/computer/updateComputer',
    method: 'post',
    params: {
      id:row.id,
      dname:row.dname,
      pid:row.pid,
      color:row.color,
      createTime:row.createTime,
      shellTime:row.shellTime
    }
  })
}

export const getAllComputerType = (id) => {
  return request({
    url: '/api/computer/getAllComputerType',
    method: 'post',
    params: {
      id
    }
  })
}

